package com.futong.cloud.utils;

import com.futong.cloud.action.ActionContext;
import com.futong.cloud.dao.CloudClientMapper;
import com.futong.cloud.dao.entity.CloudClient;

public class ClientUtils {
    public static CloudClient getClient(String clientId){
        return CloudClientMapper.Mappers.client.selectById(clientId);
    }
    public static void setCloudClient(ActionContext context){
        String clientId = ContextUtils.getValueByFiledName(context,"clientId");
        CloudClient client =getClient(clientId);
        context.cloudClient=client;
    }
    public static void setCloudClient(String clientId,ActionContext context){
        CloudClient client = getClient(clientId);
        context.cloudClient=client;
    }
}
